<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="msg" v-on:keydown="keydown">
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: "控制台输出按键的keycode"
            }
            ,
            methods: {
                keydown(e){
                    console.log("按键的keycode: " + e.keyCode)
                }
            }
        })
    </script>
</body>
</html>